package com.wl.week_01.Homework_01;

/**
 * 电子书类继承自Book类
 * @author TaiZai
 * @data 2024/9/20 17:32
 */
public class EBook extends Book{
    private Integer fileSize;

    public String getDetails() {
        return String.format("%-5s\t%-5s\t %-5s\t%-5.2f5\t\t%-5s\t%-5s\t%-5s",
                getTitle(), "电子书", getAuthor(), getPrice(), "-", fileSize + "MB", "-");
    }

    public EBook(String title, String author, double price, Integer fileSize) {
        super(title, author, price);
        this.fileSize = fileSize;
    }

    public Integer getFileSize() {
        return fileSize;
    }

    public void setFileSize(Integer fileSize) {
        this.fileSize = fileSize;
    }
}
